<?php

$userParams=require(dirname(__FILE__).'/params.php');

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'MamiCook',
	'language'=>'zh_CN',
	'defaultController'=>'recipe',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
	),

	// application components
	'components'=>array(
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CWebLogRoute',
					'levels'=>'info, error, warning',
				),
				array(
					'class'=>'CProfileLogRoute',
				),
                array(
                    'class'=>'CFileLogRoute',
					'logPath'=>'protected/log',
                ),
			),
		),
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
			// force 403 HTTP error if authentication needed
			'loginUrl'=>array('user/login'),
		),
		// uncomment the following to set up database
		'db'=>array(
			'connectionString'=>'mysql:host=localhost;dbname=cooking',
			'username'=>'cooking',
			'password'=>'cooking',
            'schemaCachingDuration'=>3600,
            'emulatePrepare'=>true,
            'enableParamLogging'=>true,
            'enableProfiling'=>true,
		),
        'cache'=>array(
            'class'=>'system.caching.CDummyCache',
        ),        
		'urlManager'=>array(
			'urlFormat'=>'path',
		),
		'clientScript'=>array(
			'coreScriptUrl'=>$userParams['systemAsset']['jsBaseUrl'].'core',
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>$userParams,
);
